;(function($){

	jQuery.extend({
		//totop控制
		ToTopCtrl:function(){

					$('#onlinebox-conbox-contact ul li').on('click',function(){
						var at = $(this).attr('class');
						switch(at){
							case "top":
								$("html,body").animate({scrollTop:0},100);
							break;
							//以后有再加
							default:
						}
					});
						
					 $(window).scroll(function(){
						if($('#onlinebox-conbox-contact')){
							if($(window).scrollTop() > 100) {
								$('#onlinebox-conbox-contact').css("display","block");
							}else{
								$('#onlinebox-conbox-contact').css("display","none");
							}

						}
					});
				
				}
				
				
	}); 

})(jQuery); 


$(function(){
	
  $("<link>")
	.attr({ rel: "stylesheet",
		type: "text/css",
		href: "http://style.gzcanr.com/css/front/popover.css"
	}).appendTo("head");
 
 
  var $qqBox = $('#contact-qq-box');
  var qq_contet = $qqBox.html();
  var options = {
	  'animation': false,
	  'trigger':'manual',
	  'placement':'left',
	  'html':true,
	  'content':qq_contet
  }
  $('#onlinebox-conbox-contact').find('.qq').popover(options)
  .on("mouseenter", function () {
		  var _this = this;
		  $(this).popover("show");
		  $(this).siblings(".popover").on("mouseleave", function () {
			  $(_this).popover('hide');
		  });
	  }).on("mouseleave", function () {
		  var _this = this;
		  setTimeout(function () {
			  if (!$(".popover:hover").length) {
				  $(_this).popover("hide")
			  }
		  }, 50);
	  });
	  
	  
	  
  var $telBox = $('#contact-tel-box');
  var tel_contet = $telBox.html();
  var options = {
	  'animation': false,
	  'trigger':'manual',
	  'placement':'left',
	  'html':true,
	  'content':tel_contet
  }
  $('#onlinebox-conbox-contact').find('.tel').popover(options)
  .on("mouseenter", function () {
		  var _this = this;
		  $(this).popover("show");
		  $(this).siblings(".popover").on("mouseleave", function () {
			  $(_this).popover('hide');
		  });
	  }).on("mouseleave", function () {
		  var _this = this;
		  setTimeout(function () {
			  if (!$(".popover:hover").length) {
				  $(_this).popover("hide")
			  }
		  }, 50);
	  });
					
					
});
